products = [["iphone",6888],['Macpro',14800],["小米6",2499],["Coffee",31],["Book",60],["Nike",699]]
shops = []
shop_car = []
shop_cost = 0
shop_id = 0
flag = 1

print("-------------商品列表--------------")
for shop,cost in products:
    shop_id += 1
    print(shop_id,shop,cost,sep='\t')

while flag:
    opt = input("您想要点什么,退出请按q").strip()
    if opt == "q":
        flag = 0
    elif opt in "123456":
        shops.append(products[int(opt)-1])
        #todo  添加个某商品已经购买成功
    else:
        print("您的输入有误，请重新输入:")
        print("请输入1-6:")
for shop,cost in shops:
    shop_car.append(shop)
    shop_cost += cost

print("您所选购的商品为{},您需要支付{}元".format(shop_car,shop_cost))

# 来个购买成功的提示